package com.siyu.tickets.entity.base;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.siyu.tickets.entity.Ticket;

public abstract class BaseTicket implements Serializable {

	private static final long serialVersionUID = 9103287827523254901L;

	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private Integer id;

	// fields
	private String code;

	private BigDecimal money;

	private Boolean isSend;
	private Boolean valid;

	private Date createTime;
	private Date sendTime;
	private Date expireTime;
	private Date consumeTime;

	private Integer verifyCount = 0;

	// many to one
	private com.siyu.tickets.entity.Partner partner;
	private com.siyu.tickets.entity.Product product;
	private com.siyu.tickets.entity.Supplier supplier;
	private com.siyu.tickets.entity.Order order;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public BigDecimal getMoney() {
		return money;
	}

	public void setMoney(BigDecimal money) {
		this.money = money;
	}

	public Boolean getIsSend() {
		return isSend;
	}

	public void setIsSend(Boolean isSend) {
		this.isSend = isSend;
	}

	public Boolean getValid() {
		return valid;
	}

	public void setValid(Boolean valid) {
		this.valid = valid;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getSendTime() {
		return sendTime;
	}

	public void setSendTime(Date sendTime) {
		this.sendTime = sendTime;
	}

	public Date getExpireTime() {
		return expireTime;
	}

	public void setExpireTime(Date expireTime) {
		this.expireTime = expireTime;
	}

	public Date getConsumeTime() {
		return consumeTime;
	}

	public void setConsumeTime(Date consumeTime) {
		this.consumeTime = consumeTime;
	}

	public Integer getVerifyCount() {
		return verifyCount;
	}

	public void setVerifyCount(Integer verifyCount) {
		this.verifyCount = verifyCount;
	}

	public com.siyu.tickets.entity.Partner getPartner() {
		return partner;
	}

	public void setPartner(com.siyu.tickets.entity.Partner partner) {
		this.partner = partner;
	}

	public com.siyu.tickets.entity.Product getProduct() {
		return product;
	}

	public void setProduct(com.siyu.tickets.entity.Product product) {
		this.product = product;
	}

	public com.siyu.tickets.entity.Supplier getSupplier() {
		return supplier;
	}

	public void setSupplier(com.siyu.tickets.entity.Supplier supplier) {
		this.supplier = supplier;
	}

	public com.siyu.tickets.entity.Order getOrder() {
		return order;
	}

	public void setOrder(com.siyu.tickets.entity.Order order) {
		this.order = order;
	}

	public boolean equals(Object obj) {
		if (null == obj)
			return false;
		if (!(obj instanceof Ticket))
			return false;
		else {
			Ticket user = (Ticket) obj;
			if (null == this.getId() || null == user.getId())
				return false;
			else
				return (this.getId().equals(user.getId()));
		}
	}

	public int hashCode() {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId())
				return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}

}
